﻿using System.Threading.Tasks;
using System.Web.Mvc;
using Abp.Web.Mvc.Authorization;
using FutureApp.Authorization;
using FutureApp.Users;

namespace FutureApp.Web.Controllers
{
    [AbpMvcAuthorize(PermissionNames.Pages_Users)]
    public class UsersController : Controller
    {
        public IUserAppService UserAppService { get; set; }

        public async Task<ActionResult> List()
        {
            var output = await this.UserAppService.GetUsers();
            return this.View(output);
        }

        public ActionResult Add()
        {
            return this.View();
        }

        public async Task<ActionResult> Edit(long id)
        {
            var output = await this.UserAppService.GetUser(id);
            return this.View(output);
        }
    }
}